<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.ListMunicipioTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:form styleClass="jsfcrud_list_form">
                <h:panelGroup id="messagePanel" styleClass="ajustaListaMensagemErro"  layout="block">
                    <h:messages errorStyle="color: red" infoStyle="color: green" layout="list"/>
                </h:panelGroup>
                <h:outputText escape="false" value="#{bundle.ListMunicipioEmpty}" rendered="#{municipioController.items.rowCount == 0}"/>
                <h:panelGroup rendered="#{municipioController.items.rowCount > 0}">
                    <h:outputText value="#{municipioController.pagination.pageFirstItem + 1}..#{municipioController.pagination.pageLastItem + 1}/#{municipioController.pagination.itemsCount}"/>&nbsp;
                    <h:commandLink action="#{municipioController.previous}" value="#{bundle.Previous} #{municipioController.pagination.pageSize}" rendered="#{municipioController.pagination.hasPreviousPage}"/>&nbsp;
                    <h:commandLink action="#{municipioController.next}" value="#{bundle.Next} #{municipioController.pagination.pageSize}" rendered="#{municipioController.pagination.hasNextPage}"/>&nbsp;
                    <h:dataTable value="#{municipioController.items}" var="item" border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px">
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListMunicipioTitle_munCd}"/>
                            </f:facet>
                            <h:outputText value="#{item.munCd}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListMunicipioTitle_munCdIbge}"/>
                            </f:facet>
                            <h:outputText value="#{item.munCdIbge}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListMunicipioTitle_munNm}"/>
                            </f:facet>
                            <h:outputText value="#{item.munNm}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListMunicipioTitle_munSg}"/>
                            </f:facet>
                            <h:outputText value="#{item.munSg}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListMunicipioTitle_munArTotalKm2}"/>
                            </f:facet>
                            <h:outputText value="#{item.munArTotalKm2}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListMunicipioTitle_munQtPopulacao}"/>
                            </f:facet>
                            <h:outputText value="#{item.munQtPopulacao}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListMunicipioTitle_munGmPoligono}"/>
                            </f:facet>
                            <h:outputText value="#{item.munGmPoligono}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListMunicipioTitle_munMicCd}"/>
                            </f:facet>
                            <h:outputText value="#{item.munMicCd}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListMunicipioTitle_munArUrbanaKm2}"/>
                            </f:facet>
                            <h:outputText value="#{item.munArUrbanaKm2}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListMunicipioTitle_munArRuralKm2}"/>
                            </f:facet>
                            <h:outputText value="#{item.munArRuralKm2}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListMunicipioTitle_munDtEmancipacao}"/>
                            </f:facet>
                            <h:outputText value="#{item.munDtEmancipacao}">
                                <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                            </h:outputText>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListMunicipioTitle_munAaReferencia}"/>
                            </f:facet>
                            <h:outputText value="#{item.munAaReferencia}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListMunicipioTitle_munNmMunicipioOrigem}"/>
                            </f:facet>
                            <h:outputText value="#{item.munNmMunicipioOrigem}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListMunicipioTitle_ufdCd}"/>
                            </f:facet>
                            <h:outputText value="#{item.ufdCd}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="&nbsp;"/>
                            </f:facet>
                            <h:commandLink action="#{municipioController.prepareView}" value="#{bundle.ListMunicipioViewLink}"/>
                            <h:outputText value=" "/>
                            <h:commandLink action="#{municipioController.prepareEdit}" value="#{bundle.ListMunicipioEditLink}"/>
                            <h:outputText value=" "/>
                            <h:commandLink action="#{municipioController.destroy}" value="#{bundle.ListMunicipioDestroyLink}"/>
                        </p:column>
                    </h:dataTable>
                </h:panelGroup>
                <br />
                <h:commandLink action="#{municipioController.prepareCreate}" value="#{bundle.ListMunicipioCreateLink}"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.ListMunicipioIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
